package com.sinodata.bsm.common.vo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * MonitorType entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "RES_GROUP")
public class ResGroup implements java.io.Serializable, Comparable {

    private static final long serialVersionUID = -571681814875703484L;

    // Fields
    private Long id;
    private String name;
    private Long parentId;
    private Long monitorTypeId;
    private Long resViewId;
    private Long resId;
    private Integer type;
    private String descript;

    private Integer seq;
    private Long containType;

    // Constructors

    /** default constructor */
    public ResGroup() {
    }

    /** minimal constructor */
    public ResGroup(Long id) {
        this.id = id;
    }

    // Property accessors

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequence")
    @SequenceGenerator(name = "sequence", sequenceName = "RES_GROUP_SEQ")
    @Column(name = "ID", unique = true, nullable = false, precision = 18, scale = 0)
    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "NAME", length = 32)
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "DESCRIPT", length = 128)
    public String getDescript() {
        return this.descript;
    }

    public void setDescript(String descript) {
        this.descript = descript;
    }

    @Column(name = "SEQ", precision = 9, scale = 0)
    public Integer getSeq() {
        return this.seq;
    }

    public void setSeq(Integer seq) {
        this.seq = seq;
    }

    @Override
    public String toString() {
        return "MonitorType [id=" + id + ", name=" + name + ",  descript=" + descript + ",  seq=" + seq + "]";
    }

    @Override
    public int compareTo(Object o) {
        ResGroup another = (ResGroup) o;
        return this.id - another.id > 0 ? 1 : -1;
    }

    @Column(name = "PARENT_ID", precision = 18, scale = 0)
    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    @Column(name = "MONITOR_TYPE_ID", precision = 18, scale = 0)
    public Long getMonitorTypeId() {
        return monitorTypeId;
    }

    public void setMonitorTypeId(Long monitorTypeId) {
        this.monitorTypeId = monitorTypeId;
    }

    @Column(name = "RES_VIEW_ID", precision = 18, scale = 0)
    public Long getResViewId() {
        return resViewId;
    }

    public void setResViewId(Long resViewId) {
        this.resViewId = resViewId;
    }

    @Column(name = "RES_ID", precision = 18, scale = 0)
    public Long getResId() {
        return resId;
    }

    public void setResId(Long resId) {
        this.resId = resId;
    }

    @Column(name = "TYPE", precision = 9, scale = 0)
    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    @Column(name = "CONTAIN_TYPE", precision = 18, scale = 0)
    public Long getContainType() {
        return containType;
    }

    public void setContainType(Long containType) {
        this.containType = containType;
    }

}